package com.zte.springboot_smbms.service.impl;

import com.zte.springboot_smbms.mapper.SmbmsBillMapper;
import com.zte.springboot_smbms.pojo.SmbmsBill;
import com.zte.springboot_smbms.service.BillsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class BillsServiceImpl implements BillsService {
    @Autowired
    private SmbmsBillMapper smbmsBillMapper;
    @Override
    @Transactional(readOnly = true)
    public List<SmbmsBill> findAllBill() {
        return smbmsBillMapper.findAllBill();
    }

    @Override
    @Transactional(readOnly = true)
    public List<SmbmsBill> findBillById(Long id) {
        return smbmsBillMapper.findBillById(id);
    }

    @Override
    @Transactional(readOnly = false)
    public boolean addBill(SmbmsBill bill) {
        return smbmsBillMapper.addBill(bill);
    }

    @Override
    @Transactional(readOnly = false)
    public boolean delBill(Long id) {
        return smbmsBillMapper.delBill(id);
    }

    @Override
    @Transactional(readOnly = false)
    public boolean updateBill(Long id, SmbmsBill bill) {
        return smbmsBillMapper.updateBill(id,bill);
    }

    @Override
    @Transactional(readOnly = true)
    public List<SmbmsBill> findBillByParam(String queryProductName, Integer queryProviderId, Integer queryIsPayment) {
        return smbmsBillMapper.findBillByParam(queryProductName,queryProviderId,queryIsPayment);
    }
}
